﻿<%@ Import Namespace="ScrumDashboardMvc.Models" %>
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ProjectSprintCollection>>" %>

<asp:Content ID="ch" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="<%=Page.ResolveUrl("~/Content/Home/Home.css")%>" rel="stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="cm" ContentPlaceHolderID="MainContent" runat="server">

<div class="sitenav">
    <ul>
        <li><a class="selected" href="#">Home</a></li>
        <li><a href="Options">Options</a></li>
        <li><a href="About">About</a></li>
    </ul>
</div>

<!--[if lte IE 7]>
<br><h2 style="color: red;">Hmm. You should upgrade your copy of Internet Explorer to at least version 8. Scrum Dashboard may not function correctly right now..</h2>
<![endif]-->

<% if (Model.Count() == 0)
   { %>
   No projects based on Scrum for Team System v3 was found!
<% } %>

<div class="projects">
    <% foreach (var psc in Model) { %>
    <table class="project">
        <caption><%= psc.Project.Name %></caption>
        <thead><tr><th>Id</th><th>Title</th><th>State</th><th>Start</th><th>End</th></tr></thead>
        <tbody>
            <% foreach (var s in psc.Sprints) { %>
            <tr class="Sprint <%= s.SprintStart < DateTime.Now && DateTime.Now < s.SprintEnd ? "Current" : "" %>">
                <td><a href="<%=System.Configuration.ConfigurationManager.AppSettings["tfsWebAccess"] + "/wi.aspx?id=" + s.Id%>" class="BacklogId" target="_blank">#<%: s.Id%></a></td>
                <td><%= Html.ActionLink(s.Title, "Index", "Dashboard", new { project = psc.Project.Name, sprint = s.Id }, null) %></td>
                <td><%: s.State%></td>
                <td><%: s.SprintStart.ToShortDateString() %></td>
                <td><%: s.SprintEnd.ToShortDateString() %></td>
            </tr>
            <% } %>
        </tbody>
    </table>
    <% } %>
</div>
</asp:Content>
